package de.dhbw.karlsruhe.picsim.gui.control;

import de.dhbw.karlsruhe.picsim.gui.Debugger;
import de.dhbw.karlsruhe.picsim.model.cpu.ProgramCounter;

/**
 * Created by IntelliJ IDEA.
 * User: user
 * Date: May 4, 2010
 * Time: 6:52:47 PM
 */
public final class DebugControl {

    private final ProgramCounter programCounter;
    private final Debugger debugger;

    public DebugControl(ProgramCounter programCounter, Debugger debugger) {
        this.programCounter = programCounter;
        this.debugger = debugger;
    }

    boolean shouldStop() {
        return debugger.isBreakPoint(programCounter.getCurrentValue().asInteger());
    }

}
